package com.design.AdapterMode.AdapterDemo;

import java.util.ArrayList;
import java.util.List;

public class AdapterManager {

    private List<IFilterService> sensitiveWordFilters = new ArrayList<>();

    public void addAdapter(IFilterService sensitiveWordFilter) {
        sensitiveWordFilters.add(sensitiveWordFilter);
    }

    public String filter(String word){
        for(IFilterService sensitiveWordFilter: sensitiveWordFilters){
            word = sensitiveWordFilter.filter(word);
        }
        return word;
    }
}
